﻿using Assistant.Preview;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using WebAssistant.BusinessLogic;
using WebAssistant.BusinessLogic.Model;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace Assistant.Controllers
{
    [ApiController]
    //[Route("api/[controller]")]
    [Route("api/interfaces")]
    public class InterFacesController : ControllerBase
    {
        private readonly ILogger<InterFacesController> _logger;

        public InterFacesController(ILogger<InterFacesController> logger)
        {
            _logger = logger;
        }

        [HttpGet]
        [Consumes("application/json")]
        public IEnumerable<Interfaces> Get()
        {
            return DataAccess.GetInterfaceList(); 
        }

        [HttpGet]
        [Consumes("application/json")]
        [Route("~/api/interfaces/run")]
        public IEnumerable<Interfaces> GetRun()
        {
            return DataAccess.GetRunningInterfaceList();
        }

    }
}
